package com.example.controller;

import com.example.common.Rest;
import com.example.entity.User;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试
 *
 * @author zy
 */
@Api(tags = "首页模块")
@RestController
public class IndexController {

    @ApiImplicitParam(name = "name", value = "姓名", required = true)
    @ApiOperation(value = "向客人问好")
    @GetMapping("/sayHi")
    public Rest<User> sayHi(@RequestParam(value = "name") String name) {
        User user = User.builder().id(1L).username("test").password("test").build();
        Rest<User> rest = new Rest<>();
        rest.setData(user);
        return rest;
    }

}